package it.uniroma3.engine;

import it.uniroma3.engine.model.CandidateProteinName;
import it.uniroma3.engine.model.comparator.CompareCandidatesByName;
import it.uniroma3.engine.model.comparator.CompareCandidatesByRank;
import it.uniroma3.engine.util.Utils;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

import org.apache.commons.io.IOUtils;

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
//		List<String> list = new LinkedList<String>();
//		
//		list.add("aaa");
//		list.add("bbb");
//		list.add("ccc");
//		list.add("ddd");
//		
//		File directory = new File("Tests");
//		if(!directory.exists()) {
//			directory.mkdir();
//		}
//		if(directory.isDirectory()) {
//			File file = new File("pippo.txt");
//			try {
//				IOUtils.writeLines(list, null, new FileOutputStream(directory.getPath() + directory.separator + file.getName()), "UTF-8");
//			} catch (FileNotFoundException e) {
//				// TODO Auto-generated catch block
//				e.printStackTrace();
//			} catch (IOException e) {
//				// TODO Auto-generated catch block
//				e.printStackTrace();
//			}
//		}
		
		List<CandidateProteinName> listTestValues = new LinkedList<CandidateProteinName>();
		
		listTestValues.add(new CandidateProteinName("p twenty-one-activated kinase 1", 1.4f));
		listTestValues.add(new CandidateProteinName("p 21 activated kinase 1", 1.0f));
		listTestValues.add(new CandidateProteinName("p 21 activated kinase 0", 1.2f));
		listTestValues.add(new CandidateProteinName("p twenty-one-activated kinase 1", 1.2f));
		listTestValues.add(new CandidateProteinName("p twenty-one-activated kinase 0", 1.3f));
		
//		CandidateProteinName c1 = new CandidateProteinName("ciccio", 1.0f);
//		CandidateProteinName c2 = new CandidateProteinName("ciccio", 1.0f);
//		System.out.println(c1.equals(c2));
		System.out.println(listTestValues);
		System.out.println("\n");
		
//		CompareCandidatesByRank cbr = new CompareCandidatesByRank();
//		Collections.sort(listTestValues, cbr);
//		System.err.println(listTestValues);
		
		listTestValues = Utils.removeDuplicatedCandidatesAndReorder(listTestValues);
		System.out.println(listTestValues);
//		
//		CompareCandidatesByName cbn = new CompareCandidatesByName();
//		Collections.sort(listTestValues, cbn);

//		System.err.println(listTestValues);
		
	}

}
